package com.blue.base.common.enums;

/**
 * @author liulei
 * @version 1.0
 */
public enum OperateTypeEnum {

    /**
     * 操作类型
     */
    SAVE(1, "插入记录"),

    UPDATE(2, "修改记录"),

    DELETE(3, "删除记录");

    private Integer code;
    private String desc;

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    OperateTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static OperateTypeEnum getByCode(Integer code) {
        OperateTypeEnum[] enums = OperateTypeEnum.values();
        for (OperateTypeEnum e : enums) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }
}
